<extend name="Public/base" />

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>商品介绍编辑</h2>
	</div>
	<div class="cf">
		<div class="fl">
            <a class="btn" href="{:U('add', array('pid' => $pid))}">新 增</a>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
	<table class="">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">序号</th>
		<th class="">ID</th>
		<th class="">标题</th>
		<th class="">类型</th>
		<th class="">操作</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
			<td>{$key + 1} </td>
			<td>{$vo.id}</td>
			<td>
				<eq name="vo.type" value="1">{$vo.name}<else /><a href="{:U('index', array('id' => $vo['id']))}">{$vo.name}</a></eq>
			</td>
			<td><if condition="$vo.type eq 1">文本框<elseif condition="$vo.type eq 2" />选择框<else />--</if></td>
			<td>
				<a href="{:U('edit', array('id' => $vo['id']))}">修改</a>
				<a href="{:U('Common/delCommon?table=goods_info&id='.$vo['id'])}" class="ajax-get">删除</a>
            </td>
		</tr>
		</volist>
		<else/>
		<td colspan="5" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
	<script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

	<script type="text/javascript">
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
	//回车搜索
	$(".search-input").keyup(function(e){
		if(e.keyCode === 13){
			$("#search").click();
			return false;
		}
	});
    //导航高亮
    highlight_subnav('{:U('GoodsInfo/index')}');
	</script>
</block>
